package com.changgou.consume.dao;

import com.changgou.seckill.pojo.SeckillGoods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;


public interface SeckillGoodsMapper extends Mapper<SeckillGoods> {

    /**
     * 更新mysql中的库存数据
     *
     * @param id
     * @return int
     * @throws
     * @description
     * @author kfzhao
     * @date 2022/1/7 0:39
     */
    @Update("update tb_seckill_goods set stock_count=stock_count-1 where id=#{id} and stock_count>=1;")
    int updateStockCount(@Param("id") Long id);
}
